package com.xyh;

import feign.Feign;
import feign.jaxb.JAXBContextFactory;
import feign.jaxb.JAXBDecoder;
import feign.jaxb.JAXBEncoder;

public class XMLTest {
    public static  void main(String[] args){
        JAXBContextFactory jaxbContextFactory=new JAXBContextFactory.Builder().build();
        HelloClient client= Feign.builder().encoder(new JAXBEncoder(jaxbContextFactory)).decoder(new JAXBDecoder(jaxbContextFactory)).target(HelloClient.class,"http://localhost:8080/");
        Person person=new Person();
        person.setId(1);
        person.setName("angus");
        person.setAge(33);
        Result result = client.createXMLPerson(person);
        System.out.println(result.getMessage());
    }
}
